<div class="row">
  <div class="col-6">
    <h3>Currencies</h3>
  </div>
  <div class="col-6">
    <%= link_to 'New currency', new_admin_currency_path, class: "btn btn-primary pull-right mb-3" %>
  </div>
</div>

<div class="card">
  <%= table_for @currencies, class: 'table table-condensed table-striped' do |t| %>
    <% t.column 'Code' do |x| %>
      <%= x.code.upcase %>
    <% end %>

    <% t.column 'Symbol' do |x| %>
      <span class="h5"><%= x.symbol %></span>
    <% end %>

    <% t.column 'Type' do |x| %>
      <%= x.type.capitalize %>
    <% end %>

    <% t.column 'Created at' do |x| %>
      <%= l(x.created_at, format: :long) %>
    <% end %>

    <% t.column 'Enabled' do |x| %>
      <%= x.enabled? ? 'Yes' : 'No' %>
    <% end %>

    <% t.column 'Actions' do |x| %>
      <%= link_to 'View', admin_currency_path(x), target: '_blank' %>
    <% end %>
  <% end %>

  <%= paginate @currencies %>
</div>
